cmake_minimum_required( VERSION 2.8 )
project("t-13")
find_package( Qt4 REQUIRED QtXml QtGui QtCore QtWebKit)
include( ${QT_USE_FILE} )
INCLUDE_DIRECTORIES(
    ${QT_INCLUDE_DIR}
    ${CMAKE_CURRENT_BINARY_DIR}
)

set( HEADERS
        mainwindow.h
        diaaddperson.h
        diasetx.h
        diasettings.h
)

set( CPPS
        main.cpp
        mainwindow.cpp
        diaaddperson.cpp
        diasetx.cpp
        diasettings.cpp
)
set( UIS
        mainwindow.ui
        diaaddperson.ui
        diasetx.ui
        diasettings.ui
)

qt4_wrap_ui(UIS_H ${UIS})

qt4_wrap_cpp( MOC_SOURCES ${HEADERS} )

set( RESOURCES res.qrc )
qt4_add_resources( QRC_SOURCES ${RESOURCES} )

add_executable( t-13 ${CPPS} ${MOC_SOURCES} ${UIS_H} ${QRC_SOURCES} ${QT_QTXML_LIBRARY})

target_link_libraries( t-13  ${QT_LIBRARIES} )

# install for linux
if(${CMAKE_SYSTEM_NAME} STREQUAL Linux)
    set(rootdir ${CMAKE_INSTALL_PREFIX})
    set(rootdir_bin ${rootdir}/bin)
    install(TARGETS t-13 DESTINATION ${rootdir_bin})
endif()
# install for mac os x
if(${CMAKE_SYSTEM_NAME} STREQUAL Darwin)
    set(rootdir ${CMAKE_INSTALL_PREFIX})
    set(rootdir_bin ${rootdir}/bin)
    install(TARGETS t-13 DESTINATION ${rootdir_bin})
endif()


